package com.highcom.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.MatrixVariable;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
public class MaxVariableController {

    // 请求路径/cars/sell;low=34;brand=byd
    //springboot默认关闭了矩阵变量，需要手动开启
    @GetMapping("/cars/{path}")
    public Map carsSell(@PathVariable("path")String path,
                        @MatrixVariable("low") Integer low,
                        @MatrixVariable("brand")List<String> brand
                        ){
        Map<String,Object> map = new HashMap<>();
        map.put("path",path);
        map.put("low",low);
        map.put("brand",brand);
        return map;
    }

}
